package cn.edu.nju.software.grapheditor.cmd;

import java.awt.Graphics;
import java.awt.Point;

import cn.edu.nju.software.grapheditor.Drawing;
import cn.edu.nju.software.grapheditor.shape.Shape;

/** @author smy */
// Written on May 21th
public class DeleteCmd extends Command {
	private Graphics g;
	public DeleteCmd(Graphics g){
		this.g=g;
	}
	public void executeClick(Point p, Drawing dwg) {
          Shape s=dwg.getFrontmostContainer(p);
          dwg.delshape(s);
          dwg.draw(g);
	}
}
